package svc

import (
	"github.com/zeromicro/go-zero/zrpc"
	"navi-mumbai/app/mq/usercenter/internal/config"
	"navi-mumbai/app/rpc/stat/client/statsys"
	"navi-mumbai/app/rpc/usercenter/client/ucsys"
	"navi-mumbai/app/rpc/wallet/client/walletsys"
)

type ServiceContext struct {
	Config config.Config

	UcSysRpc     ucsys.UcSys
	WalletSysRpc walletsys.WalletSys
	StatSysRpc   statsys.StatSys
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,

		UcSysRpc:     ucsys.NewUcSys(zrpc.MustNewClient(c.UsercenterRpcConf)),
		WalletSysRpc: walletsys.NewWalletSys(zrpc.MustNewClient(c.WalletRpcConf)),
		StatSysRpc:   statsys.NewStatSys(zrpc.MustNewClient(c.StatRpcConf)),
	}
}
